package com.sc.nft.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.DaoSchoolArticleMaterial;
import com.sc.nft.entity.dto.DaoSchoolMaterialArticlePageAdminDTO;
import com.sc.nft.entity.vo.ArticleMaterialVO;
import com.sc.nft.entity.vo.DaoSchoolMaterialArticlePageAdminVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 素材表与文章表关联表(DaoSchoolArticleMaterial)表数据库访问层
 *
 * @author makejava
 * @since 2023-03-13 16:21:34
 */
public interface DaoSchoolArticleMaterialMapper extends BaseMapper<DaoSchoolArticleMaterial> {

    /**
     * 后台获取分页列表
     *
     * @param page
     * @param daoSchoolMaterialArticlePageAdminDTO
     * @return
     */
    Page<DaoSchoolMaterialArticlePageAdminVO> pageAdmin(Page page, @Param("data") DaoSchoolMaterialArticlePageAdminDTO daoSchoolMaterialArticlePageAdminDTO);

    /**
     * 后台获取分页列表
     *
     * @param daoSchoolMaterialArticlePageAdminDTO
     * @return
     */
    Page<DaoSchoolMaterialArticlePageAdminVO> pageNotAdmin(Page page, @Param("data") DaoSchoolMaterialArticlePageAdminDTO daoSchoolMaterialArticlePageAdminDTO);

    /**
     * 批量入库
     *
     * @param list
     * @return
     */
    Integer saveBatch(@Param("list") List<DaoSchoolArticleMaterial> list);

    /**
     * 根据文章id获取关联数据
     *
     * @param id
     * @return
     */
    List<ArticleMaterialVO> selectByArticleId(@Param("id") Long id);

}
